	<!-- BEGIN PAGE -->
	<div class="page-content">
         <!-- BEGIN PAGE CONTAINER-->        
         <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
			<div class="row-fluid">
				<div class="span12"> 
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->			
					<h3 class="page-title">
						Pembagian Kelas <small>pengaturan pembagian kelas</small>
					</h3>
					<ul class="breadcrumb">
						<li>
							<i class="icon-cogs"></i>
							Pengaturan Tahunan	
							<i class="icon-angle-right"></i>
						</li>
						<li>Pembagian Kelas</li>	
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN PAGE CONTENT-->          
            <div class="row-fluid">
               <div class="span12">
					<!-- BEGIN SAMPLE TABLE PORTLET-->
                  <div class="portlet box blue">
                     <div class="portlet-title">
                        <div class="caption"><i class="icon-filter"></i>Penyaringan Data</div>
                     </div>
                     <div class="portlet-body flip-scroll">
						<form id="filter" action="" class="form-horizontal" method="post">
							<div class="row-fluid">
								<div class="span4">
									<div class="control-group">
										<label class="control-label" >Departemen:</label>
										<div class="controls">
											<select class="span12 m-wrap" id="departemen" name="departemen" onchange='$("#filter").submit();'>
												<?php foreach($departemen->result_array() as $row){?>
												 <option value="<?php echo $row['departemen_id']?>" <?php echo $row['departemen_id'] == $departemen_id?'selected="selected"':'' ?>><?php echo $row['nama']?></option>
												<?php } ?>
											</select>
										</div>
									</div>
								</div>
								<div class="span4">
									<div class="control-group">
										<label class="control-label" >Tahun Ajaran:</label>
										<div class="controls">
											<select class="span12 m-wrap" id="tahun_ajaran" name="tahun_ajaran" onchange='$("#filter").submit();'>
												<?php foreach($tahun_ajaran->result_array() as $row){?>
												 <option value="<?php echo $row['tahun_ajaran_id']?>" <?php echo $row['tahun_ajaran_id'] == $tahun_ajaran_id?'selected="selected"':'' ?>><?php echo $row['tahun_ajaran']?><?php echo $row['aktif'] == 1?' (AKTIF)':''?></option>
												<?php } ?>
											</select>
										</div>
									</div>
								</div>
							</div>
							<div class="row-fluid">
								<div class="span4">
									<div class="control-group">
										<label class="control-label" >Kelas:</label>
										<div class="controls">
											<select class="span12 m-wrap" id="kelas" name="kelas" onchange='$("#filter").submit();'>
												<?php foreach($kelas->result_array() as $row){?>
												 <option value="<?php echo $row['tingkat_id']?>" <?php echo $row['tingkat_id'] == $kelas_id?'selected="selected"':'' ?>><?php echo $row['tingkat']?></option>
												<?php } ?>
											</select>
										</div>
									</div>
								</div>
								<div class="span4">
									<div class="control-group">
										<label class="control-label" >Jurusan:</label>
										<div class="controls">
											<select class="span12 m-wrap" id="jurusan" name="jurusan" onchange='$("#filter").submit();'>
												<?php foreach($jurusan->result_array() as $row){?>
												 <option value="<?php echo $row['jurusan_id']?>" <?php echo $row['jurusan_id'] == $jurusan_id?'selected="selected"':'' ?>><?php echo $row['jurusan']?></option>
												<?php } ?>
											</select>
										</div>
									</div>
								</div>
								<div class="span4">
									<div class="control-group">
										<div class="controls">
											<input type="submit" class="btn blue btn-block" name="filter" value="SARING DATA" />
										</div>
									</div>
								</div>
							</div>
						 </form>
                     </div>
                  </div>
                  <!-- END SAMPLE TABLE PORTLET-->
				  <?php if(isset($pembagian_kelas)){?>
				  <!-- BEGIN SAMPLE TABLE PORTLET-->
                  <div class="portlet box blue">
                     <div class="portlet-title">
                        <div class="caption"><i class="icon-cogs"></i>Data Pembagian Kelas</div>
						<div class="tools">
                           <a href="<?php echo base_url()?>pembagianKelas/form/<?php echo encode($departemen_id)."/".encode($tahun_ajaran_id)."/".encode($kelas_id)."/".encode($jurusan_id)?>" class="btn blue"><i class="icon-plus"></i> Tambah</a>
                        </div>
                     </div>
                     <div class="portlet-body flip-scroll">
                        <table class="table table-bordered table-striped table-condensed flip-content table-hover">
							<thead class="flip-content">
								<tr>
									<tr>
										<th align="center">Ruang Kelas</th>	
									    <th align="center">Kapasitas</th>
										<th align="center">Wali Kelas</th>
										<th align="center">Kelas</th>
										<th align="center">Tahun Ajaran</th>
										<th align="center">Aktif</th>
										<th align="center">Keterangan</th>
										<th align="center">Aksi</th>
									</tr>
								</tr>
							</thead>
                           <tbody>
								<?php
									foreach($pembagian_kelas->result_array() as $row){
										echo "<tr>";
										echo "<td>$row[kelas]</td>";
										echo "<td>$row[kapasitas]</td>";
										echo "<td>$row[nama]</td>";
										echo "<td>$row[tingkat]</td>";
										echo "<td>$row[tahun_ajaran]</td>";
										echo "<td>";
											if($row['aktif'] == 1)
												echo "<a class=\"btn mini green\"><i class=\"icon-ok\"></i> AKTIF</a>";
											else
												echo "<a class=\"btn mini red\"><i class='icon-remove'></i> NON-AKTIF</a>";
										echo "</td>";
										echo "<td>$row[keterangan]</td>";
										echo "<td align='center'>
										<a href=\"".base_url()."pembagianKelas/form/".encode($departemen_id)."/".encode($row['tahun_ajaran_id'])."/".encode($row['tingkat_id'])."/".encode($row['jurusan_id'])."/".encode($row['kelas_id'])."\" title=\"Edit\" class=\"btn mini green\"><i class=\"icon-edit\"></i> Edit</a>
										<a href=\"".base_url()."pembagianKelas/delete/".encode($departemen_id)."/".encode($row['tahun_ajaran_id'])."/".encode($row['tingkat_id'])."/".encode($row['jurusan_id'])."/".encode($row['kelas_id'])."\" title=\"Hapus\" class=\"btn mini red\" onClick=\"return confirm('Data akan dihapus. Lanjutkan ?')\"><i class=\"icon-trash\"></i> Hapus</a>
										</td>";
										echo "</tr>";
									}
									
									if($pembagian_kelas->num_rows() == 0){
										echo "<tr>";
										echo "<td colspan=8><div class=\"alert alert-error\">Tidak ada data pembagian kelas untuk departemen yang dipilih. Klik tombol tambah untuk menambahkan data.</div></td>";
										echo "</tr>";
									}
								?>
                           </tbody>
                       </table>
                     </div>
                  </div>
                  <!-- END SAMPLE TABLE PORTLET-->
				  <?php }else{ ?>
						<div class="alert alert-info">Silahkan pilih departemen, tahun ajaran, kelas dan jurusan lalu klik tombol <strong>SARING DATA</strong> untuk menampilkan data pembagian (ruang) kelas.</div>
					<?php }?>
				  
               </div>              
            </div>
            <!-- END PAGE CONTENT-->
         </div>
         <!-- END PAGE CONTAINER-->
    </div>
    <!-- END PAGE -->
	<?php $this->load->view('template/messages'); ?>